﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Model.Student;

namespace IDAL.Student
{
    /// <summary>
    /// 数据层接口。
    /// </summary>
    public interface IStudent
    {
        /// <summary>
        /// 新增
        /// </summary>
        /// <param name="obj">实体对象</param>
        /// <returns>新插入记录的编号</returns>
        void Insert(StudentEntity obj);

        /// <summary>
        /// 修改
        /// </summary>
        /// <param name="obj">实体对象</param>
        void Update(StudentEntity obj);

        /// <summary>
        /// 删除
        /// </summary>
        /// <param name="id">记录编号</param>
        void Delete(string id);

        /// <summary>
        /// 获得单个实体
        /// </summary>
        /// <param name="id">记录编号</param>
        /// <returns>实体对象</returns>
        StudentEntity GetInfo(string id);

        /// <summary>
        /// 按指定条件获得记录数
        /// </summary>
        /// <param name="condition">查询条件</param>
        /// <returns>记录数</returns>
        int GetCount(StudentEntity.SearchCondition condition);

        /// <summary>
        /// 按指定条件获得查询结果
        /// </summary>
        /// <param name="startIndex">记录开始索引，从1开始。如果startIndex和endIndex都为0表示不分页</param>
        /// <param name="endIndex">结束索引</param>
        /// <param name="condition">查询条件</param>
        /// <returns>实体集</returns>
        List<StudentEntity> GetList(int startIndex, int endIndex, StudentEntity.SearchCondition condition);
    }
}
